<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function draw() {
            var canvas = document.getElementById('canvas');
            if (canvas.getContext){
                var ctx = canvas.getContext('2d');

                var rectangle = new Path2D();
                rectangle.rect(10, 10, 50, 50);

                var circle = new Path2D();
                circle.moveTo(125, 35);
                circle.arc(100, 35, 25, 0, 2 * Math.PI);

                ctx.stroke(rectangle);
                ctx.fill(circle);
            }
        }
    </script>
</head>
<body>
<body onload="draw()">
<canvas id="canvas" width="300px" height="300px"></canvas>
</body>
</body>
</html>